import React, { useState, useEffect } from 'react';
import { Drawer, Button, Space, Radio, InputNumber, DatePicker } from 'antd'
import TableDataBlock from '@/components/TableDataBlock';
import PopImgShow from '@/components/PopImgShow';
import moment from 'moment';
import { connect } from 'umi'
const InitiateLotteryUser = (props) => {
  const { visible = {}, onClose, dispatch, reload, } = props;
  const { detail = {}, show = false, title } = visible;
  const { list } = detail

  const getColumns = [
    {
      title: '中奖人姓名',
      dataIndex: 'username',
    },
    {
      title: '用户头像',
      dataIndex: 'profile',
      render: (e) => {
        return <PopImgShow url={e}></PopImgShow>
      },
    },
    {
      title: '奖品名称',
      dataIndex: 'username',
    },
    {
      title: '奖品图片',
      dataIndex: 'goodsCover',
      render: (e) => {
        return <PopImgShow url={e}></PopImgShow>
      },
    },
    {
      title: '中奖时间',
      dataIndex: 'createTime',
    },
  ];

  const modalProps = {
    visible: show,
    title: `${title}的中奖名单`,
    width: 800,
    onClose: onClose,
    destroyOnClose: true,
    footer: null
  }

  return (
    <Drawer {...modalProps}>
      <TableDataBlock
        list={list}
        columns={getColumns}
        rowKey={(record) => `${record.id}`}
      ></TableDataBlock>
    </Drawer>
  );
};
export default connect(({ loading }) => ({

}))(InitiateLotteryUser); 